bfd: Fix typo in comment.
[sliver-openvswitch.git] / lib / bfd.c
index 95dad2d..22c9cae 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -229,7 +229,8 @@ bfd_get_status(const struct bfd *bfd, struct smap *smap)
 /* Initializes, destroys, or reconfigures the BFD session 'bfd' (named 'name'),
  * according to the database configuration contained in 'cfg'.  Takes ownership
  * of 'bfd', which may be NULL.  Returns a BFD object which may be used as a
- * handle for the session, or NULL if BFD is not enabled according to 'cfg'. */
+ * handle for the session, or NULL if BFD is not enabled according to 'cfg'.
+ * Also returns NULL if cfg is NULL. */
 struct bfd *
 bfd_configure(struct bfd *bfd, const char *name,
               const struct smap *cfg)
@@ -246,7 +247,7 @@ bfd_configure(struct bfd *bfd, const char *name,
         init = true;
     }
 
-    if (!smap_get_bool(cfg, "enable", false)) {
+    if (!cfg || !smap_get_bool(cfg, "enable", false)) {
         if (bfd) {
             hmap_remove(&all_bfds, &bfd->node);
             free(bfd->name);
@@ -413,8 +414,10 @@ bfd_put_packet(struct bfd *bfd, struct ofpbuf *p,
 }
 
 bool
-bfd_should_process_flow(const struct flow *flow)
+bfd_should_process_flow(const struct flow *flow, struct flow_wildcards *wc)
 {
+    memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
+    memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
     return (flow->dl_type == htons(ETH_TYPE_IP)
             && flow->nw_proto == IPPROTO_UDP
             && flow->tp_dst == htons(3784));
@@ -779,7 +782,7 @@ generate_discriminator(void)
     while (!disc) {
         struct bfd *bfd;
 
-        /* 'disc' is by defnition random, so there's no reason to waste time
+        /* 'disc' is by definition random, so there's no reason to waste time
          * hashing it. */
         disc = random_uint32();
         HMAP_FOR_EACH_IN_BUCKET (bfd, node, disc, &all_bfds) {