Commit 88ebbaf0 authored by David S. Miller's avatar David S. Miller

Merge branch 'vxlan-create-and-changelink-extack-support'

Roopa Prabhu says:

====================
vxlan: create and changelink extack support

This series adds extack support to changelink paths.
In the process re-factors flag sets to a separate helper.
Also adds some changelink testcases to rtnetlink.sh

(This series was initially part of another series that
tried to support changelink for more attributes.
But after some feedback from sabrina, i have dropped the
'support changelink for more attributes' part because some
of them cannot be supported today or may require additional
use-case handling code. These can be done separately
as and when we see the need for it.)
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 703bdcbc da640bc0
This diff is collapsed.
......@@ -453,4 +453,35 @@ vxlan_fdb_clear_offload(const struct net_device *dev, __be32 vni)
}
#endif
static inline void vxlan_flag_attr_error(int attrtype,
struct netlink_ext_ack *extack)
{
#define VXLAN_FLAG(flg) \
case IFLA_VXLAN_##flg: \
NL_SET_ERR_MSG_MOD(extack, \
"cannot change " #flg " flag"); \
break
switch (attrtype) {
VXLAN_FLAG(TTL_INHERIT);
VXLAN_FLAG(LEARNING);
VXLAN_FLAG(PROXY);
VXLAN_FLAG(RSC);
VXLAN_FLAG(L2MISS);
VXLAN_FLAG(L3MISS);
VXLAN_FLAG(COLLECT_METADATA);
VXLAN_FLAG(UDP_ZERO_CSUM6_TX);
VXLAN_FLAG(UDP_ZERO_CSUM6_RX);
VXLAN_FLAG(REMCSUM_TX);
VXLAN_FLAG(REMCSUM_RX);
VXLAN_FLAG(GBP);
VXLAN_FLAG(GPE);
VXLAN_FLAG(REMCSUM_NOPARTIAL);
default:
NL_SET_ERR_MSG_MOD(extack, \
"cannot change flag");
break;
}
#undef VXLAN_FLAG
}
#endif
......@@ -408,6 +408,58 @@ kci_test_encap_vxlan()
ip netns exec "$testns" ip link add link "$vxlan" name "$vlan" type vlan id 1
check_err $?
# changelink testcases
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan vni 43 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan group ffe5::5 dev "$devdummy" 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan ttl inherit 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan ttl 64
check_err $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan nolearning
check_err $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan proxy 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan norsc 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan l2miss 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan l3miss 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan external 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan udpcsum 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan udp6zerocsumtx 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan udp6zerocsumrx 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan remcsumtx 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan remcsumrx 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan gbp 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link set dev "$vxlan" type vxlan gpe 2>/dev/null
check_fail $?
ip netns exec "$testns" ip link del "$vxlan"
check_err $?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment