@@ -66,6 +66,8 @@
* @IFF_LOWER_UP: driver signals L1 up. Volatile.
* @IFF_DORMANT: driver signals dormant. Volatile.
* @IFF_ECHO: echo sent packets. Volatile.
+ * @IFF_PROTO_DOWN: protocol is down on the interface. Can be toggeled
+ * through sysfs.
*/
enum net_device_flags {
IFF_UP = 1<<0, /* sysfs */
@@ -87,6 +89,7 @@ enum net_device_flags {
IFF_LOWER_UP = 1<<16, /* __volatile__ */
IFF_DORMANT = 1<<17, /* __volatile__ */
IFF_ECHO = 1<<18, /* __volatile__ */
+ IFF_PROTO_DOWN = 1<<19, /* sysfs */
};
#define IFF_UP IFF_UP
@@ -108,6 +111,7 @@ enum net_device_flags {
#define IFF_LOWER_UP IFF_LOWER_UP
#define IFF_DORMANT IFF_DORMANT
#define IFF_ECHO IFF_ECHO
+#define IFF_PROTO_DOWN IFF_PROTO_DOWN
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
@@ -119,6 +119,7 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
_PF(LOWER_UP);
_PF(DORMANT);
_PF(ECHO);
+ _PF(PROTO_DOWN);
#undef _PF
if (flags)
fprintf(fp, "%x", flags);
@@ -64,6 +64,7 @@ void iplink_usage(void)
fprintf(stderr, " [ multicast { on | off } ]\n");
fprintf(stderr, " [ allmulticast { on | off } ]\n");
fprintf(stderr, " [ promisc { on | off } ]\n");
+ fprintf(stderr, " [ protodown { on | off } ]\n");
fprintf(stderr, " [ trailers { on | off } ]\n");
fprintf(stderr, " [ txqueuelen PACKETS ]\n");
fprintf(stderr, " [ name NEWNAME ]\n");
@@ -494,6 +495,15 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
req->i.ifi_flags |= IFF_NOARP;
} else
return on_off("noarp", *argv);
+ } else if (strcmp(*argv, "protodown") == 0) {
+ NEXT_ARG();
+ req->i.ifi_change |= IFF_PROTO_DOWN;
+ if (strcmp(*argv, "on") == 0) {
+ req->i.ifi_flags |= IFF_PROTO_DOWN;
+ } else if (strcmp(*argv, "off") == 0) {
+ req->i.ifi_flags &= ~IFF_PROTO_DOWN;
+ } else
+ return on_off("protodown", *argv);
} else if (strcmp(*argv, "vf") == 0) {
struct rtattr *vflist;
NEXT_ARG();
@@ -1076,6 +1086,15 @@ static int do_set(int argc, char **argv)
flags |= IFF_NOARP;
} else
return on_off("noarp", *argv);
+ } else if (strcmp(*argv, "protodown") == 0) {
+ NEXT_ARG();
+ mask |= IFF_PROTO_DOWN;
+ if (strcmp(*argv, "on") == 0) {
+ flags |= IFF_PROTO_DOWN;
+ } else if (strcmp(*argv, "off") == 0) {
+ flags &= ~IFF_PROTO_DOWN;
+ } else
+ return on_off("protodown", *argv);
} else if (matches(*argv, "dynamic") == 0) {
NEXT_ARG();
mask |= IFF_DYNAMIC;
@@ -93,6 +93,8 @@ ip-link \- network device configuration
.br
.BR multicast " { " on " | " off " } |"
.br
+.BR protodown " { " on " | " off " } |"
+.br
.B txqueuelen
.IR PACKETS " |"
.br
@@ -622,6 +624,12 @@ change the
flag on the device.
.TP
+.BR "protodown on " or " protodown off"
+change the
+.B PROTODOWN
+flag on the device.
+
+.TP
.BR "dynamic on " or " dynamic off"
change the
.B DYNAMIC