#include "if.h"
#include "lib_errors.h"
-#include "isisd/dict.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_network.h"
+#include "isisd/isis_pdu.h"
#include "privs.h"
* ISO 10589 - 8.4.8
*/
-uint8_t ALL_L1_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x14};
-uint8_t ALL_L2_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x15};
-uint8_t ALL_ISS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x05};
-uint8_t ALL_ESS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x04};
+static const uint8_t ALL_L1_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x14};
+static const uint8_t ALL_L2_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x15};
+#if 0
+/* missing support for P2P-over-LAN / ES-IS on BSD */
+static const uint8_t ALL_ISS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x05};
+static const uint8_t ALL_ESS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x04};
+#endif
static char sock_buff[8192];
{
int retval = ISIS_OK;
- if (isisd_privs.change(ZPRIVS_RAISE))
- zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not raise privs, %s",
- __func__, safe_strerror(errno));
+ frr_with_privs(&isisd_privs) {
- retval = open_bpf_dev(circuit);
+ retval = open_bpf_dev(circuit);
- if (retval != ISIS_OK) {
- zlog_warn("%s: could not initialize the socket", __func__);
- goto end;
- }
+ if (retval != ISIS_OK) {
+ zlog_warn("%s: could not initialize the socket",
+ __func__);
+ break;
+ }
- if (if_is_broadcast(circuit->interface)) {
- circuit->tx = isis_send_pdu_bcast;
- circuit->rx = isis_recv_pdu_bcast;
- } else {
- zlog_warn("isis_sock_init(): unknown circuit type");
- retval = ISIS_WARNING;
- goto end;
+ if (if_is_broadcast(circuit->interface)) {
+ circuit->tx = isis_send_pdu_bcast;
+ circuit->rx = isis_recv_pdu_bcast;
+ } else {
+ zlog_warn("isis_sock_init(): unknown circuit type");
+ retval = ISIS_WARNING;
+ break;
+ }
}
-end:
- if (isisd_privs.change(ZPRIVS_LOWER))
- zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not lower privs, %s",
- __func__, safe_strerror(errno));
-
return retval;
}
int isis_recv_pdu_bcast(struct isis_circuit *circuit, uint8_t *ssnpa)
{
- int bytesread = 0, bytestoread, offset, one = 1, err = ISIS_OK;
+ int bytesread = 0, bytestoread, offset, one = 1;
uint8_t *buff_ptr;
struct bpf_hdr *bpf_hdr;
memcpy(ssnpa, buff_ptr + bpf_hdr->bh_hdrlen + ETHER_ADDR_LEN,
ETHER_ADDR_LEN);
- err = isis_handle_pdu(circuit, ssnpa);
+ isis_handle_pdu(circuit, ssnpa);
stream_reset(circuit->rcv_stream);
buff_ptr += BPF_WORDALIGN(bpf_hdr->bh_hdrlen +
bpf_hdr->bh_datalen);