Merge branch 'iproute2-master' into iproute2-next

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2018-08-13 07:46:26 -07:00
commit c044be6b34
3 changed files with 12 additions and 17 deletions

View File

@ -49,9 +49,9 @@ static void usage(void) __attribute__((noreturn));
static void usage(void)
{
if (do_link) {
if (do_link)
iplink_usage();
}
fprintf(stderr, "Usage: ip address {add|change|replace} IFADDR dev IFNAME [ LIFETIME ]\n");
fprintf(stderr, " [ CONFFLAG-LIST ]\n");
fprintf(stderr, " ip address del IFADDR dev IFNAME [mngtmpaddr]\n");
@ -77,7 +77,7 @@ static void usage(void)
fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | lowpan |\n");
fprintf(stderr, " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan | vti |\n");
fprintf(stderr, " nlmon | can | bond_slave | ipvlan | geneve | bridge_slave |\n");
fprintf(stderr, " hsr | macsec | netdevsim\n");
fprintf(stderr, " hsr | macsec | netdevsim }\n");
exit(-1);
}
@ -1946,7 +1946,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
exit(1);
}
delete_json_obj();
exit(0);
goto out;
}
if (filter.family != AF_PACKET) {

View File

@ -82,19 +82,13 @@ int netns_switch(char *name)
/* Mount a version of /sys that describes the network namespace */
if (statvfs("/sys", &fsstat) < 0) {
fprintf(stderr, "could not stat /sys (not mounted?): %s\n",strerror(errno));
return -1;
}
if (fsstat.f_flag & ST_RDONLY) {
/* If /sys is not writable (e.g. in a container), we can't
* unmount the old /sys instance, but we can still mount a new
* read-only instance over it. */
mountflags = MS_RDONLY;
} else {
if (umount2("/sys", MNT_DETACH) < 0) {
fprintf(stderr, "umount of /sys failed: %s\n", strerror(errno));
return -1;
if (umount2("/sys", MNT_DETACH) < 0) {
/* If this fails, perhaps there wasn't a sysfs instance mounted. Good. */
if (statvfs("/sys", &fsstat) == 0) {
/* We couldn't umount the sysfs, we'll attempt to overlay it.
* A read-only instance can't be shadowed with a read-write one. */
if (fsstat.f_flag & ST_RDONLY)
mountflags = MS_RDONLY;
}
}
if (mount(name, "/sys", "sysfs", mountflags, NULL) < 0) {

View File

@ -405,6 +405,7 @@ static int batch(const char *name)
err = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf,
tail == NULL ? 0 : sizeof(tail->buf));
fflush(stdout);
if (err != 0) {
fprintf(stderr, "Command failed %s:%d\n", name,
cmdlineno - 1);