From 3f57bfa0b2f5f850e8d73978ba4128f36ab6fbd6 Mon Sep 17 00:00:00 2001 From: Park Ju Hyung Date: Mon, 25 Feb 2019 23:04:07 +0900 Subject: [PATCH 1/2] Handle (ifa_addr == NULL) gracefully ifa_addr could be NULL for interfaces without an address assigned. Since we're iterating through all interfaces for filtering AF_INET, ignoring ones with ifa_addr set to NULL is safe. This solves a segmentation fault issue on systems that has an interface with no address assigned. Signed-off-by: Park Ju Hyung --- mtcp/src/io_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mtcp/src/io_module.c b/mtcp/src/io_module.c index ed2f493..126c94f 100644 --- a/mtcp/src/io_module.c +++ b/mtcp/src/io_module.c @@ -374,7 +374,7 @@ SetNetEnv(char *dev_name_list, char *port_stat_list) iter_if = ifap; do { - if (iter_if->ifa_addr->sa_family == AF_INET && + if (iter_if->ifa_addr && iter_if->ifa_addr->sa_family == AF_INET && !set_all_inf && (seek=strstr(dev_name_list, iter_if->ifa_name)) != NULL && /* check if the interface was not aliased */ @@ -473,7 +473,7 @@ SetNetEnv(char *dev_name_list, char *port_stat_list) iter_if = ifap; do { - if (iter_if->ifa_addr->sa_family == AF_INET && + if (iter_if->ifa_addr && iter_if->ifa_addr->sa_family == AF_INET && !set_all_inf && (seek=strstr(dev_name_list, iter_if->ifa_name)) != NULL && /* check if the interface was not aliased */ @@ -623,7 +623,7 @@ SetNetEnv(char *dev_name_list, char *port_stat_list) iter_if = ifap; do { - if (iter_if->ifa_addr->sa_family == AF_INET && + if (iter_if->ifa_addr && iter_if->ifa_addr->sa_family == AF_INET && !set_all_inf && (seek=strstr(dev_name_list, iter_if->ifa_name)) != NULL && /* check if the interface was not aliased */ From f401b7a8ba7ff6cf9fde154c5a10ccab3a5e4ea6 Mon Sep 17 00:00:00 2001 From: Park Ju Hyung Date: Mon, 25 Feb 2019 23:13:01 +0900 Subject: [PATCH 2/2] README: improve a notice regarding NetworkManager address override Signed-off-by: Park Ju Hyung --- README | 11 ++++++++--- README.md | 13 ++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README b/README index a43084b..8eacdcc 100644 --- a/README +++ b/README @@ -296,9 +296,14 @@ We tested the DPDK version (polling driver) with Linux-3.13.0 kernel. - Use ^C to gracefully shutdown the application. Two consecutive ^C (separated by 1 sec) will force quit. -2. My application keeps printing "No route to 0.0.0.0" - - Try to turn off your network-manager for xge*. The network manager - can override the IP configuration set by install.py in PSIO driver. +2. My application doesn't use the address specified from ifconfig. + - For some Linux distros(e.g. Ubuntu), NetworkManager may re-assign + a different IP address, or delete the assigned IP address. + + Disable NetworkManager temporarily if that's the case. + NetworkManager will be re-enabled upon reboot. + + # sudo service network-manager stop 3. Can I statically set the routing or arp table? - Yes, mTCP allows static route and arp configuration. Go to the diff --git a/README.md b/README.md index 158f527..94cfebb 100644 --- a/README.md +++ b/README.md @@ -342,9 +342,16 @@ We tested the DPDK version (polling driver) with Linux-3.13.0 kernel. - Use ^C to gracefully shutdown the application. Two consecutive ^C (separated by 1 sec) will force quit. -2. My application keeps printing "No route to 0.0.0.0" - - Try to turn off your network-manager for xge*. The network manager - can override the IP configuration set by install.py in PSIO driver. +2. My application doesn't use the address specified from ifconfig. + - For some Linux distros(e.g. Ubuntu), NetworkManager may re-assign + a different IP address, or delete the assigned IP address. + + - Disable NetworkManager temporarily if that's the case. + NetworkManager will be re-enabled upon reboot. + + ```bash + sudo service network-manager stop + ``` 3. Can I statically set the routing or arp table? - Yes, mTCP allows static route and arp configuration. Go to the