Commit f3ae88b3 authored by Alessandro Rubini's avatar Alessandro Rubini

net: trivial simplifcations related to previous commit

(one is just a comment update: most of that stanza was not true any more)
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7f668484
......@@ -83,9 +83,7 @@ PACKED struct wr_timestamp {
};
// Creates UDP or Ethernet RAW socket (determined by sock_type) bound
// to bind_addr. If PTPD_FLAG_MULTICAST is set, the socket is
// automatically added to multicast group. User can specify
// physical_port field to bind the socket to specific switch port only.
// to bind_addr.
struct wrpc_socket *ptpd_netif_create_socket(struct wrpc_socket *s,
struct wr_sockaddr * bind_addr,
int udp_or_raw, int udpport);
......
......@@ -20,8 +20,7 @@ static struct wrpc_socket *latency_socket, __static_latency_socket = {
};
static struct wr_sockaddr latency_addr = {
.mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, /* for binding */
.mac_dest = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, /* for sending */
.mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, /* for sending */
.ethertype = 0, /* htons(CONFIG_LATENCY_ETHTYPE) -- not constant! */
};
......
......@@ -52,7 +52,6 @@ struct wrpc_socket *ptpd_netif_create_socket(struct wrpc_socket *sock,
{
int i;
struct hal_port_state pstate;
static mac_addr_t zero_mac;
/* Look for the first available socket. */
for (i = 0; i < ARRAY_SIZE(socks); i++)
......@@ -72,8 +71,6 @@ struct wrpc_socket *ptpd_netif_create_socket(struct wrpc_socket *sock,
memset(&sock->bind_addr, 0, sizeof(struct wr_sockaddr));
if (bind_addr)
memcpy(&sock->bind_addr, bind_addr, sizeof(struct wr_sockaddr));
if (!memcmp(sock->bind_addr.mac, zero_mac, ETH_ALEN))
get_mac_addr(sock->bind_addr.mac);
sock->bind_addr.udpport = 0;
if (udp_or_raw == PTPD_SOCK_UDP) {
sock->bind_addr.ethertype = htons(0x0800); /* IPv4 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment