summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
AgeCommit message (Collapse)Author
2016-12-21pimd: Fix use of 0 for NULLDonald Sharp
pimd uses allot of 0's to represent NULL. Not a good programming practice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Refactor pim message receiveDonald Sharp
We were using a variety of techniques to handle incoming pim packets. Refactor to use a switch statement to handle the incoming packets. Also add the ability to notice that we are getting a register stop. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fixup some dead codeDonald Sharp
Remove some dead code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-20build: remove $Format tagsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-08-18*: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma
(cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
2016-06-29pimd: Make received packet zlog_err a zlog_debugDonald Sharp
When receiving packets and the parse fails a zlog_err is generated. This should be protected by a debug. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-28pimd: Bind pim sockets to interface they are associated withDonald Sharp
When pim is receiving packets, each interface's fd is receiving packets for all interfaces. Modify the code to bind the pim interface sockets to the interface they were created for. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-17pimd: Prevent loopback from forming neighborDonald Sharp
This code prevents pim from forming a neighbor relationship with itself by preventing pim from sending a hello out the loopback interface if we have pim configured on an interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-17pimd: Separate pim vif index spot from ifindexDonald Sharp
Allow pim to separate out the pim vif index from the ifindex. This change will allow pim to work with up to 255(MAXVIFS) interfaces, while also allowing the interface ifindex to be whatever number it needs to be. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-17pimDonald Sharp
2016-06-09pimd: Fix of using uninitialized MemoryDonald Sharp
Valgrind is reporting that pimd is using uninitialized memory for comparisons. This commit addresses the issues found there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Start handling of pim REGISTER packet typeDonald Sharp
This code starts the handling of the pim register type. No guarantees that it works correctly, just that it compiles and the start of the code is in there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Limit pim hello log messagesDonald Sharp
pimd was outputting allot of data surrounding pim hello packets. In addition the debugging was inconsistent and not all turned on via 'debug pim packet hello'. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Notice when we receive a packet type we can't handle yetDonald Sharp
There are PIM packet types that have not been implemented yet. Notice when we get one of those and safely do nothing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Fix leaked fdDonald Sharp
When caling pim_sock_open if the failure cause happens, however unlikely, don't leak the fd on failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Ensure new generation_id is different from previousDonald Sharp
The RFC states that an interfaces generation_id must be changed if it experiences an if down. From 4.3.1: The GenID option contains a randomly generated 32-bit value that is regenerated each time PIM forwarding is started or restarted on the interface, including when the router itself restarts. Since we are only grabbing a new generation_id without comparing it to the previous generation_id, it is possible that random can generate the exact same number. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: Stop DR election on every helloDonald Sharp
The DR election is occurring on every hello received. This is because the hello receive packet returns a 0 for any successfully received packet. PIMD then looked at the 0 returned and did a DR election. Code was inspected for the cases where DR should happen: (A) Interface ip address change (B) DR priority in hello packet changes (C) Received a new neighbor on an interface (D) Neighbor timer pops. Each of these initiate a DR election in the code currently. Testing was initiated on a pim network: tor-11# show ip pim designated-router NonPri: Number of neighbors missing DR Priority hello option Interface Address DR Uptime Elections Changes NonPri br1 20.0.15.1 20.0.15.1 00:08:16 1 1 0 swp1 169.254.0.10 169.254.0.10 00:08:16 2 1 0 swp2 169.254.0.26 169.254.0.26 00:08:16 2 1 0 tor-11# As you can see Elections == 2. This is because pimd performs an election on (A) and (C) above. I see no need to modify (A) to check if we have any knowledge of the interface before this call. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25PIMD: Fix code to use srandom/randomDonald Sharp
pimd rolled it's own solution to random #'s, that was not terribly random. Rely on the underlying system to generate random #'s for us Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25pimd: cast to sockaddr_in to sockaddrDavid Lamparter
While glibc seems to have something in the system headers that prevents this from triggering a warning, FreeBSD doesn't. Fix the warning. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25pimd: merge pimd as of 2015-01-19David Lamparter
Welcome pimd to the Quagga daemon zoo! This is a merge of commit 77ae369 ("pimd: Log ifindex found for an interface when zebra lib reports a new connected address."), with the intermediate "reconnect" changes removed (c9adf00...d274381). d274381 is replaced with b162ab7, which includes some changes. In addition, 4 reconnect-related changes and 1 cosmetic one have been bumped out. The rebase command used to produce the branch that is merged here is: git rebase --onto b162ab7 c9adf00 77ae369 Note that 3 patches had their author rewritten from "Anonymous SR#108542 <>" (which is not a valid git author ID) to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address listed in the associated Savannah ticket) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>