[systemd-devel] [PATCH v2 5/9] test-icmp6-rs: Add trivial test case for an MTU that is not present

Patrik Flykt patrik.flykt at linux.intel.com
Tue Jan 20 09:36:00 PST 2015


---
 src/libsystemd-network/test-icmp6-rs.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/libsystemd-network/test-icmp6-rs.c b/src/libsystemd-network/test-icmp6-rs.c
index be64d33..9d50c57 100644
--- a/src/libsystemd-network/test-icmp6-rs.c
+++ b/src/libsystemd-network/test-icmp6-rs.c
@@ -93,6 +93,8 @@ static void test_rs_done(sd_icmp6_nd *nd, int event, void *userdata) {
                 { ND_RA_FLAG_OTHER, ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER },
                 { ND_RA_FLAG_MANAGED, ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED }
         };
+        uint32_t mtu;
+
         assert_se(nd);
 
         assert_se(event == flag_event[idx].event);
@@ -101,10 +103,14 @@ static void test_rs_done(sd_icmp6_nd *nd, int event, void *userdata) {
         if (verbose)
                 printf("  got event %d\n", event);
 
-        if (idx < 3)
+        if (idx < 3) {
                 send_ra(flag_event[idx].flag);
-        else
-                sd_event_exit(e, 0);
+                return;
+        }
+
+        assert_se(sd_icmp6_ra_get_mtu(nd, &mtu) == -ENOMSG);
+
+        sd_event_exit(e, 0);
 }
 
 static void test_rs(sd_event *e) {
-- 
2.1.4



More information about the systemd-devel mailing list