Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babeld: Add Flags checking in Hello TLV #18212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions babeld/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
unsigned int timestamp = 0;

#define BABEL_UNICAST_HELLO 0x8000
#define BABEL_MULTICAST_HELLO 0x0000
DO_NTOHS(flags, message + 2);

/*
Expand All @@ -425,6 +426,13 @@ parse_packet(const unsigned char *from, struct interface *ifp,
goto done;
}

if (!CHECK_FLAG(flags, BABEL_MULTICAST_HELLO)) {
debugf(BABEL_DEBUG_COMMON,
"Received Hello from %s on %s with Unknown Flags %d",
format_address(from), ifp->name, flags);
goto done;
}

DO_NTOHS(seqno, message + 4);
DO_NTOHS(interval, message + 6);
debugf(BABEL_DEBUG_COMMON,
Expand Down
Loading