Some minor fixes.

This commit is contained in:
Ondrej Zajicek 2012-08-06 11:09:13 +02:00
parent 5400c0e7f9
commit c06de722dd
2 changed files with 5 additions and 3 deletions

View file

@ -502,15 +502,17 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
continue; continue;
} }
#else /* OSPFv3 */ #else /* OSPFv3 */
u16 scope = ntoht(lsa->type) & LSA_SCOPE_MASK;
/* 4.5.1 (2) */ /* 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); log(L_WARN "Received LSA with AS scope in stub area from %I", n->ip);
continue; continue;
} }
/* 4.5.1 (3) */ /* 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); log(L_WARN "Received LSA with invalid scope from %I", n->ip);
continue; continue;

View 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_GATEWAY] && RTA_PAYLOAD(a[RTA_GATEWAY]) != sizeof(ip_addr)) ||
(a[RTA_PRIORITY] && RTA_PAYLOAD(a[RTA_PRIORITY]) != 4) || (a[RTA_PRIORITY] && RTA_PAYLOAD(a[RTA_PRIORITY]) != 4) ||
(a[RTA_PREFSRC] && RTA_PAYLOAD(a[RTA_PREFSRC]) != sizeof(ip_addr)) || (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"); log(L_ERR "KRT: Malformed message received");
return; return;