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

8.0 backports #8827

Merged
merged 44 commits into from
Jun 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
92e19ec
ospf6d: unlink router from vrf on deletion
idryzhov May 27, 2021
4ef2323
pceplib: fix mixup of global/local variables
idryzhov May 28, 2021
09cbc07
isisd, ospf6d, pimd: set vrf_id when creating bfd sessions
idryzhov May 31, 2021
00574f0
isisd: fix using vrf interface as a loopback
idryzhov May 28, 2021
b144fae
ospf6d: fix using vrf interface as a loopback
idryzhov May 28, 2021
0e99a6c
bgpd: pass correct vrf_id to vrf_socket when creating bgp view socket
idryzhov May 31, 2021
cd89989
lib: fix binding to a vrf
idryzhov May 6, 2021
21cd75a
tests: remove tcp_l3mdev_accept setting
idryzhov May 7, 2021
fb6c9eb
doc: update VRF support description
idryzhov May 12, 2021
bfe3510
pathd: fix render candidate-path bandwidth
edipascale May 18, 2021
093a8f6
doc: Replace single tick with double tick under developer/topotests.rst
ton31337 Jun 2, 2021
753c7da
ospfd: if destroy the whole ospf, then remove ospf's interface config…
anlancs Jun 2, 2021
3f30364
doc: remove varnames from command descriptions
idryzhov Jun 2, 2021
9e3fd54
bfdd: fix bfd key structure
idryzhov Jun 1, 2021
1077c27
doc: fix link-params commands
idryzhov Jun 2, 2021
1627291
doc: add separate section for nexthop tracking
idryzhov Jun 2, 2021
b273ee4
lib, vtysh: reduce code duplication
idryzhov Jun 2, 2021
8010eb4
lib: fix output of "list" and "find" commands
idryzhov Jun 2, 2021
1d91cb7
bgpd: fix enabling bfd debug
idryzhov May 28, 2021
aeae109
lib: fix bfd multihop
idryzhov May 27, 2021
15a1754
lib: fix default ttl for single-hop bfd sessions
idryzhov Jun 1, 2021
ccb83eb
bfdd: don't store interface pointer for multihop sessions
idryzhov May 28, 2021
55d9ae7
bfdd: forbid setting interface for multihop sessions
idryzhov May 28, 2021
8ab721b
zebra: fix config after exit from vrf
idryzhov Jun 2, 2021
39a0be2
lib: fix address sanitizer crash on `find`
rzalamena Jun 7, 2021
86147fc
ospfd: fix passive interface configuration
idryzhov Jun 4, 2021
3b9c5af
doc: replace "passive-interface IFNAME" with "ip ospf passive"
idryzhov Jun 5, 2021
e68ecdc
ospfd: fix GR helper initialization and termination
rwestphal May 31, 2021
bb590fa
ospfd: fix small issue when exiting from the GR helper mode
rwestphal May 31, 2021
fc2ef24
ospfd: fix crash when logging a Grace-LSA
rwestphal May 31, 2021
16e7fe2
ospfd: fix dangling pointer when exiting from the helper mode
rwestphal May 31, 2021
d11e0c8
ospfd: fix null pointer dereference when flushing an opaque LSA
rwestphal May 31, 2021
8ff13a6
ospfd: fix cleanup of MaxAge LSAs on exit
rwestphal May 31, 2021
8f2eb95
ospfd: fix logging of what triggered the SPF run
rwestphal May 31, 2021
dd65dbe
zebra, ospfd: fix typos in the graceful restart code
rwestphal May 31, 2021
cd63b18
ospfd: fix wrong NSSA debug guards
rwestphal May 31, 2021
8e25bd9
lib, ospfd, ospf6d: fix logging of pointer addresses
rwestphal May 31, 2021
6a74bca
ospfd: fix crash when displaying neighbor data in JSON
rwestphal May 31, 2021
de4b84a
zebra: Give extra space and stop processing if we run out of space
donaldsharp Jun 8, 2021
8e85b98
ospfd: fix memory leaks in summarization
idryzhov Jun 8, 2021
0f7e131
tests: fix ospf6_topo1_vrf
idryzhov Jun 7, 2021
11712da
ospf6d: fix interface area configuration
idryzhov May 25, 2021
83ba066
doc: replace "interface IFNAME area" with "ipv6 ospf6 area"
idryzhov May 25, 2021
2cfc327
tests: replace "interface IFNAME area" with "ipv6 ospf6 area"
idryzhov Jun 7, 2021
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
Prev Previous commit
Next Next commit
ospfd: fix crash when logging a Grace-LSA
Change the "show_ospf_grace_lsa_info" callback to account for the
fact that the "vty" parameter can be null.

This fixes a crash that happens when "debug ospf packet ls-update
detail" is configured and a Grace-LSA is sent or received.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal authored and idryzhov committed Jun 9, 2021
commit fc2ef2440d10de7a147efe9d97c38b80774c1c0f
97 changes: 70 additions & 27 deletions ospfd/ospf_gr_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,72 +1020,115 @@ static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa)
lsah = (struct lsa_header *)lsa->data;

if (lsa->size <= OSPF_LSA_HEADER_SIZE) {
vty_out(vty, "%% Invalid LSA length: %d\n", length);
if (vty)
vty_out(vty, "%% Invalid LSA length: %d\n", length);
else
zlog_debug("%% Invalid LSA length: %d", length);
return;
}

length = lsa->size - OSPF_LSA_HEADER_SIZE;

vty_out(vty, " TLV info:\n");
if (vty)
vty_out(vty, " TLV info:\n");
else
zlog_debug(" TLV info:");

for (tlvh = TLV_HDR_TOP(lsah); sum < length && tlvh;
tlvh = TLV_HDR_NEXT(tlvh)) {
/* Check TLV len */
if (sum + TLV_SIZE(tlvh) > length) {
vty_out(vty, "%% Invalid TLV length: %u\n",
TLV_SIZE(tlvh));
if (vty)
vty_out(vty, "%% Invalid TLV length: %u\n",
TLV_SIZE(tlvh));
else
zlog_debug("%% Invalid TLV length: %u",
TLV_SIZE(tlvh));
return;
}

switch (ntohs(tlvh->type)) {
case GRACE_PERIOD_TYPE:
if (TLV_SIZE(tlvh) <
sizeof(struct grace_tlv_graceperiod)) {
vty_out(vty,
"%% Invalid grace TLV length %u\n",
TLV_SIZE(tlvh));
if (TLV_SIZE(tlvh)
< sizeof(struct grace_tlv_graceperiod)) {
if (vty)
vty_out(vty,
"%% Invalid grace TLV length %u\n",
TLV_SIZE(tlvh));
else
zlog_debug(
"%% Invalid grace TLV length %u",
TLV_SIZE(tlvh));
return;
}

gracePeriod = (struct grace_tlv_graceperiod *)tlvh;
sum += TLV_SIZE(tlvh);

vty_out(vty, " Grace period:%d\n",
ntohl(gracePeriod->interval));
if (vty)
vty_out(vty, " Grace period:%d\n",
ntohl(gracePeriod->interval));
else
zlog_debug(" Grace period:%d",
ntohl(gracePeriod->interval));
break;
case RESTART_REASON_TYPE:
if (TLV_SIZE(tlvh) <
sizeof(struct grace_tlv_restart_reason)) {
vty_out(vty,
"%% Invalid reason TLV length %u\n",
TLV_SIZE(tlvh));
if (TLV_SIZE(tlvh)
< sizeof(struct grace_tlv_restart_reason)) {
if (vty)
vty_out(vty,
"%% Invalid reason TLV length %u\n",
TLV_SIZE(tlvh));
else
zlog_debug(
"%% Invalid reason TLV length %u",
TLV_SIZE(tlvh));
return;
}

grReason = (struct grace_tlv_restart_reason *)tlvh;
sum += TLV_SIZE(tlvh);

vty_out(vty, " Restart reason:%s\n",
ospf_restart_reason2str(grReason->reason));
if (vty)
vty_out(vty, " Restart reason:%s\n",
ospf_restart_reason2str(
grReason->reason));
else
zlog_debug(" Restart reason:%s",
ospf_restart_reason2str(
grReason->reason));
break;
case RESTARTER_IP_ADDR_TYPE:
if (TLV_SIZE(tlvh) <
sizeof(struct grace_tlv_restart_addr)) {
vty_out(vty,
"%% Invalid addr TLV length %u\n",
TLV_SIZE(tlvh));
if (TLV_SIZE(tlvh)
< sizeof(struct grace_tlv_restart_addr)) {
if (vty)
vty_out(vty,
"%% Invalid addr TLV length %u\n",
TLV_SIZE(tlvh));
else
zlog_debug(
"%% Invalid addr TLV length %u",
TLV_SIZE(tlvh));
return;
}

restartAddr = (struct grace_tlv_restart_addr *)tlvh;
sum += TLV_SIZE(tlvh);

vty_out(vty, " Restarter address:%pI4\n",
&restartAddr->addr);
if (vty)
vty_out(vty, " Restarter address:%pI4\n",
&restartAddr->addr);
else
zlog_debug(" Restarter address:%pI4",
&restartAddr->addr);
break;
default:
vty_out(vty, " Unknown TLV type %d\n",
ntohs(tlvh->type));
if (vty)
vty_out(vty, " Unknown TLV type %d\n",
ntohs(tlvh->type));
else
zlog_debug(" Unknown TLV type %d",
ntohs(tlvh->type));

break;
}
Expand Down