]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge branch 'new' into socket2
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 11 Mar 2010 17:55:59 +0000 (18:55 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 11 Mar 2010 17:55:59 +0000 (18:55 +0100)
13 files changed:
1  2 
lib/socket.h
nest/config.Y
nest/iface.h
proto/ospf/hello.c
proto/ospf/lsupd.c
proto/ospf/neighbor.c
proto/ospf/ospf.c
proto/ospf/ospf.h
proto/ospf/packet.c
proto/ospf/rt.c
proto/ospf/topology.c
sysdep/linux/sysio.h
sysdep/unix/io.c

diff --cc lib/socket.h
Simple merge
diff --cc nest/config.Y
index f9e88d5919e510cbea73bc83af914b5972aba8c8,5a8950512576f61dfe48bb4846cc7cec69b1192f..792012e723c8bc2b13bf0d81fc6e16dbf9577d02
@@@ -459,22 -459,21 +459,21 @@@ echo_size
   ;
  
  CF_CLI(DISABLE, proto_patt, <protocol> | \"<pattern>\" | all, [[Disable protocol]])
- { proto_xxable($2, XX_DISABLE); } ;
+ { proto_apply_cmd($2, proto_cmd_disable, 1, 0); } ;
  CF_CLI(ENABLE, proto_patt, <protocol> | \"<pattern>\" | all, [[Enable protocol]])
- { proto_xxable($2, XX_ENABLE); } ;
+ { proto_apply_cmd($2, proto_cmd_enable, 1, 0); } ;
  CF_CLI(RESTART, proto_patt, <protocol> | \"<pattern>\" | all, [[Restart protocol]])
- { proto_xxable($2, XX_RESTART); } ;
+ { proto_apply_cmd($2, proto_cmd_restart, 1, 0); } ;
  CF_CLI(RELOAD, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol]])
- { proto_xxable($2, XX_RELOAD); } ;
+ { proto_apply_cmd($2, proto_cmd_reload, 1, CMD_RELOAD); } ;
  CF_CLI(RELOAD IN, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just imported routes)]])
- { proto_xxable($3, XX_RELOAD_IN); } ;
+ { proto_apply_cmd($3, proto_cmd_reload, 1, CMD_RELOAD_IN); } ;
  CF_CLI(RELOAD OUT, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just exported routes)]])
- { proto_xxable($3, XX_RELOAD_OUT); } ;
+ { proto_apply_cmd($3, proto_cmd_reload, 1, CMD_RELOAD_OUT); } ;
  
  CF_CLI_HELP(DEBUG, ..., [[Control protocol debugging via BIRD logs]])
 -CF_CLI(DEBUG, proto_patt debug_mask, (<protocol> | <pattern> | all) (all | off | { states | routes | filters | events | packets }), [[Control protocol debugging via BIRD logs]])
 +CF_CLI(DEBUG, proto_patt debug_mask, (<protocol> | <pattern> | all) (all | off | { states | routes | filters | interfaces | events | packets }), [[Control protocol debugging via BIRD logs]])
- { proto_debug($2, 0, $3); }
-  ;
+ { proto_apply_cmd($2, proto_cmd_debug, 1, $3); } ;
  
  CF_CLI_HELP(MRTDUMP, ..., [[Control protocol debugging via MRTdump files]])
  CF_CLI(MRTDUMP, proto_patt mrtdump_mask, (<protocol> | <pattern> | all) (all | off | { states | messages }), [[Control protocol debugging via MRTdump format]])
diff --cc nest/iface.h
Simple merge
index 9f174df81f670565f82510e39f65d2ee51a013f8,2f3a8a81b1e5e3e980012eb3b05dcbbc3bc6342e..7fe82801d41d488597b0cf90dc5611f8198203eb
@@@ -47,9 -47,9 +47,9 @@@ ospf_hello_receive(struct ospf_packet *
  {
    struct proto_ospf *po = ifa->oa->po;
    struct proto *p = &po->proto;
 -  char *beg = "Bad OSPF HELLO packet from ", *rec = " received: ";
 +  char *beg = "OSPF: Bad HELLO packet from ";
-   unsigned int size, i, twoway, oldpriority, eligible, peers;
-   u32 olddr, oldbdr, oldiface_id, tmp;
+   unsigned int size, i, twoway, eligible, peers;
+   u32 tmp;
    u32 *pnrid;
  
    size = ntohs(ps_i->length);
Simple merge
Simple merge
Simple merge
Simple merge
index 6697057bdae541c55a11a3b606b66e890764ffad,ea5f7a8615d423c0eeaac6118357a95cf6da9972..95f7653c6a7f0043713eb64ea964cfd956b9b12d
@@@ -266,52 -264,21 +265,52 @@@ ospf_pkt_checkauth(struct ospf_neighbo
   * non generic functions.
   */
  int
 -ospf_rx_hook(sock * sk, int size)
 +ospf_rx_hook(sock *sk, int size)
  {
 -  struct ospf_packet *ps;
 -  struct ospf_iface *ifa = (struct ospf_iface *) (sk->data);
 +  char *mesg = "OSPF: Bad packet from ";
 +
 +  /* We want just packets from sk->iface. Unfortunately, on BSD we
 +     cannot filter out other packets at kernel level and we receive
 +     all packets on all sockets */
 +  if (sk->lifindex != sk->iface->index)
 +    return 1;
 +
 +  DBG("OSPF: RX hook called (iface %s, src %I, dst %I)\n",
 +      sk->iface->name, sk->faddr, sk->laddr);
 +
 +  /* Initially, the packet is associated with the 'master' iface */
 +  struct ospf_iface *ifa = sk->data;
    struct proto_ospf *po = ifa->oa->po;
--  struct proto *p = &po->proto;
 -  struct ospf_neighbor *n;
 -  int osize;
 -  char *mesg = "Bad OSPF packet from ";
 -  struct ospf_iface *iff;
++  // struct proto *p = &po->proto;
 +
 +  int src_local = ifa_match_addr(ifa->addr, sk->faddr);
 +  int dst_local = ipa_equal(sk->laddr, ifa->addr->ip);
 +  int dst_mcast = ipa_equal(sk->laddr, AllSPFRouters) || ipa_equal(sk->laddr, AllDRouters);
  
 -  if (ifa->stub)
 -    return (1);
 +#ifdef OSPFv2
 +  /* First, we eliminate packets with strange address combinations.
 +   * In OSPFv2, they might be for other ospf_ifaces (with different IP
 +   * prefix) on the same real iface, so we don't log it. We enforce
 +   * that (src_local || dst_local), therefore we are eliminating all
 +   * such cases. 
 +   */
 +  if (dst_mcast && !src_local)
 +    return 1;
 +  if (!dst_mcast && !dst_local)
 +    return 1;
 +
 +#else /* OSPFv3 */
 +
 +  /* In OSPFv3, src_local and dst_local mean link-local. 
 +   * RFC 5340 says that local (non-vlink) packets use
 +   * link-local src address, but does not enforce it. Strange.
 +   */
 +  if (dst_mcast && !src_local)
 +    log(L_WARN "OSPF: Received multicast packet from %I (not link-local)", sk->faddr);
 +#endif
  
 -  ps = (struct ospf_packet *) ip_skip_header(sk->rbuf, &size);
 +  /* Second, we check packet size, checksum, and the protocol version */
 +  struct ospf_packet *ps = (struct ospf_packet *) ip_skip_header(sk->rbuf, &size);
  
    if (ps == NULL)
    {
diff --cc proto/ospf/rt.c
index 18dc3bbd6be1c11354fc24722c99e1d25129ec50,c856eea1f8ee8a29defd3c0b4bcb4b3aa89292a5..9a330a83de6a6446fb19ffcb36337f74d9119edc
@@@ -571,9 -569,9 +571,9 @@@ ospf_rt_sum_tr(struct ospf_area *oa
        metric = ls->metric & METRIC_MASK;
        options = 0;
        type = ORT_NET;
 -      re = (ort *) fib_find(&po->rtf, &ip, pxlen);
 +      re = fib_find(&po->rtf, &ip, pxlen);
      }
-     else if (en->lsa.type == LSA_T_SUM_RT)
+     else // en->lsa.type == LSA_T_SUM_RT
      {
  #ifdef OSPFv2
        struct ospf_lsa_sum *ls = en->lsa_body;
Simple merge
Simple merge
Simple merge