Skip to content

Commit

Permalink
Trying to debug sending setup_req messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadfisher committed Aug 9, 2010
1 parent 11b4a54 commit 1c48173
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
16 changes: 9 additions & 7 deletions vrr_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,23 @@ int send_setup_req(u_int src, u_int dest, u_int proxy)
u_int *vset = NULL;
u_int *setup_req_data;

WARN_ATOMIC;
VRR_DBG("src: %x, dest: %x, proxy: %x", src, dest, proxy);

pset_get_mac(proxy, proxy_mac);

VRR_DBG("proxy_mac: %x:%x:%x:%x:%x:%x",
proxy_mac[0],
proxy_mac[1],
proxy_mac[2],
proxy_mac[3],
proxy_mac[4],
proxy_mac[5]);

vset_size = vset_get_all(&vset);
data_size = sizeof(u_int) * (vset_size + 2);

setup_req_data = kmalloc(data_size, GFP_ATOMIC);

/* VRR_DBG("setup request src id: %x", src); */
/* setup_req_data[p++] = htonl(src); */

/* VRR_DBG("setup request dst id: %x", dest); */
/* setup_req_data[p++] = htonl(dest); */

VRR_DBG("proxy id: %x", proxy);
setup_req_data[p++] = htonl(proxy);

Expand Down
9 changes: 8 additions & 1 deletion vrr_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ static int vrr_rcv_hello(struct sk_buff *skb, const struct vrr_header *vh)

eth_header_parse(skb, src_addr);

VRR_DBG("src_addr: %x:%x:%x:%x:%x:%x",
src_addr[0],
src_addr[1],
src_addr[2],
src_addr[3],
src_addr[4],
src_addr[5]);

skb_copy_bits(skb, offset, &active, step);
active = ntohl(active);
offset += step;
Expand Down Expand Up @@ -263,7 +271,6 @@ static int vrr_rcv_setup_req(struct sk_buff *skb, const struct vrr_header *vh)
ovset);
goto out;
}
/* Send <setup_fail, me, src, proxy, ovset> to me */

out:
kfree(ovset);
Expand Down
1 change: 1 addition & 0 deletions vrr_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ int vrr_output(struct sk_buff *skb, struct vrr_node *vrr,
clone->dev = dev;
dev_hard_header(clone, dev, ETH_P_VRR, vh->dest_mac,
dev->dev_addr, clone->len);
VRR_DBG("Sending over iface %s", tmp->dev_name);
dev_queue_xmit(clone);
}
}
Expand Down

0 comments on commit 1c48173

Please sign in to comment.