ip: add AMT support
Subsystems (2)
PATCH 1/1 ip: add AMT support
Add basic support for Automatic Multicast Tunneling (AMT) network devices.
--- ip/Makefile | 3 +- ip/ip.c | 4 +- ip/iplink.c | 2 +- ip/iplink_amt.c | 227 ++++++++++++++++++++++++++++++++++++++++++ man/man8/ip-link.8.in | 46 +++++++++ 5 files changed, 278 insertions(+), 4 deletions(-) create mode 100644 ip/iplink_amt.c
ip/Makefile +2 -1
@@ -11,7 +11,8 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \ iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \ iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \ ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \ - ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o + ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o \ + iplink_amt.o RTMONOBJ=rtmon.o
ip/ip.c +2 -2
@@ -64,8 +64,8 @@ static void usage(void)fprintf (stderr,"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" " ip [ -force ] -batch filename\n" -"where OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp | link |\n" -" macsec | maddress | monitor | mptcp | mroute | mrule |\n" +"where OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |\n" +" link | macsec | maddress | monitor | mptcp | mroute | mrule |\n" " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" " ntbl | route | rule | sr | tap | tcpmetrics |\n" " token | tunnel | tuntap | vrf | xfrm }\n"
ip/iplink.c +1 -1
@@ -50,7 +50,7 @@ void iplink_types_usage(void) {/* Remember to add new entry here if new type is added. */ fprintf (stderr, -"TYPE := { bareudp | bond | bond_slave | bridge | bridge_slave |\n" +"TYPE := { amt | bareudp | bond | bond_slave | bridge | bridge_slave |\n" " dummy | erspan | geneve | gre | gretap | ifb |\n" " ip6erspan | ip6gre | ip6gretap | ip6tnl |\n" " ipip | ipoib | ipvlan | ipvtap |\n"
ip/iplink_amt.c new file +227 -0
227 lines not on this page · raw message
man/man8/ip-link.8.in +46 -0
64 lines not on this page · raw message
Signature · 1 line
2.17.1
ip/iplink_amt.c line 75
Quoted 2 lines · On Sat, 23 Oct 2021 19:36:11 +0000 Taehee Yoo <[email protected]> wrote:
ip/iplink_amt.c new file +2
-0+while (argc >0 ) { +if (matches (*argv,"mode" ) ==0 ) {
Try and reduce/eliminate use of matches() since it creates lots of problems when arguments collides. For example "m" matches mode only because it is compared first (vs "max_tunnels").
Quoted 7 lines · Stephen Hemminger
ip/iplink_amt.c line 75
Quoted 2 lines · On Sat, 23 Oct 2021 19:36:11 +0000 Taehee Yoo <[email protected]> wrote:
ip/iplink_amt.c new file +2
-0+while (argc >0 ) { +if (matches (*argv,"mode" ) ==0 ) {Try and reduce/eliminate use of
matches()since it creates
Make that do not use matches. We are not accepting that for any new command line arguments.
Quoted 3 lines
lots of problems when arguments collides. For example "m" matches mode only because it is compared first (vs "
max_tunnels").
Hi David and Stephen,
Thank you so much for the review!
Quoted 4 lines · David Ahern
Quoted 3 lines · Stephen Hemminger
On Sat, 23 Oct 2021 19:36:11 +0000
Taehee Yoo <[email protected]> wrote:
Quoted 12 lines
Quoted 4 lines
ip/iplink_amt.c line 75
Quoted 2 lines
ip/iplink_amt.c new file +2
-0+while (argc >0 ) { +if (matches (*argv,"mode" ) ==0 ) {Try and reduce/eliminate use of
matches()since it createsMake that do not use matches. We are not accepting that for any new command line arguments.
Quoted 3 lines
lots of problems when arguments collides. For example "m" matches mode only because it is compared first (vs "
max_tunnels").
Okay, I will use strccmp() instead of matches() then send the v2 patch Thanks a lot!
Taehee
ip/iplink_amt.c line 145
Quoted 2 lines · On Sat, 23 Oct 2021 19:36:11 +0000 Taehee Yoo <[email protected]> wrote:
ip/iplink_amt.c new file +2
-0+if (tb[IFLA_AMT_MODE ] &&RTA_PAYLOAD (tb[IFLA_AMT_MODE ]) <sizeof (__u32)) +return ;
What is this check here for? Is there a case where kernel returns data without valid mode?
Quoted 7 lines
ip/iplink_amt.c new file +7
-0+ +if (tb[IFLA_AMT_MODE ]) { +print_string (PRINT_ANY , +"mode" , +"%s " , + modename[rta_getattr_u32 (tb[IFLA_AMT_MODE ])]); + }
Hi Stephen,
Quoted 9 lines · Stephen Hemminger
ip/iplink_amt.c line 145
Quoted 2 lines · On Sat, 23 Oct 2021 19:36:11 +0000 Taehee Yoo <[email protected]> wrote:
ip/iplink_amt.c new file +2
-0+if (tb[IFLA_AMT_MODE ] &&RTA_PAYLOAD (tb[IFLA_AMT_MODE ]) <sizeof (__u32)) +return ;What is this check here for? Is there a case where kernel returns data without valid mode?
This is an unnecessary check. So I will drop this code at the v2 patch. Thanks a lot!
Taehee