]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Some minor fixes.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 6 Aug 2012 09:09:13 +0000 (11:09 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 6 Aug 2012 09:09:13 +0000 (11:09 +0200)
proto/ospf/lsupd.c
sysdep/linux/netlink.c

index f71c72d1d5186f4f94544b58e7e14fd8ae9c835c..16967a7f13ef085bfb78a85b2c3ef9e265e3da33 100644 (file)
@@ -502,15 +502,17 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
       continue;
     }
 #else /* OSPFv3 */
+    u16 scope = ntoht(lsa->type) & LSA_SCOPE_MASK;
+
     /* 4.5.1 (2) */
-    if ((LSA_SCOPE(lsa) == LSA_SCOPE_AS) && !oa_is_ext(ifa->oa))
+    if ((scope == LSA_SCOPE_AS) && !oa_is_ext(ifa->oa))
     {
       log(L_WARN "Received LSA with AS scope in stub area from %I", n->ip);
       continue;
     }
 
     /* 4.5.1 (3) */
-    if ((LSA_SCOPE(lsa) == LSA_SCOPE_RES))
+    if (scope == LSA_SCOPE_RES)
     {
       log(L_WARN "Received LSA with invalid scope from %I", n->ip);
       continue;
index eaaf048e1c41bfefce93ca21b2a2fa404da5d434..d1b203ef65ea6e483049c8f98ce06a739bfa58ca 100644 (file)
@@ -737,7 +737,7 @@ nl_parse_route(struct nlmsghdr *h, int scan)
       (a[RTA_GATEWAY] && RTA_PAYLOAD(a[RTA_GATEWAY]) != sizeof(ip_addr)) ||
       (a[RTA_PRIORITY] && RTA_PAYLOAD(a[RTA_PRIORITY]) != 4) ||
       (a[RTA_PREFSRC] && RTA_PAYLOAD(a[RTA_PREFSRC]) != sizeof(ip_addr)) ||
-      (a[RTA_FLOW] && RTA_PAYLOAD(a[RTA_OIF]) != 4))
+      (a[RTA_FLOW] && RTA_PAYLOAD(a[RTA_FLOW]) != 4))
     {
       log(L_ERR "KRT: Malformed message received");
       return;