rtnetlink.c (05668381140309088443bf5dc53add4104610fbb) | rtnetlink.c (70f8e78e150425b01c1099087ad3decacf7e4ccf) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Routing netlink socket interface: protocol independent part. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 380 unchanged lines hidden (view full) --- 389 390 err = dev->set_config(dev, &k_map); 391 392 if (err) 393 goto out; 394 } 395 396 if (ida[IFLA_ADDRESS - 1]) { | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Routing netlink socket interface: protocol independent part. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 380 unchanged lines hidden (view full) --- 389 390 err = dev->set_config(dev, &k_map); 391 392 if (err) 393 goto out; 394 } 395 396 if (ida[IFLA_ADDRESS - 1]) { |
397 struct sockaddr *sa; 398 int len; 399 |
|
397 if (!dev->set_mac_address) { 398 err = -EOPNOTSUPP; 399 goto out; 400 } 401 if (!netif_device_present(dev)) { 402 err = -ENODEV; 403 goto out; 404 } 405 if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len)) 406 goto out; 407 | 400 if (!dev->set_mac_address) { 401 err = -EOPNOTSUPP; 402 goto out; 403 } 404 if (!netif_device_present(dev)) { 405 err = -ENODEV; 406 goto out; 407 } 408 if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len)) 409 goto out; 410 |
408 err = dev->set_mac_address(dev, RTA_DATA(ida[IFLA_ADDRESS - 1])); | 411 len = sizeof(sa_family_t) + dev->addr_len; 412 sa = kmalloc(len, GFP_KERNEL); 413 if (!sa) { 414 err = -ENOMEM; 415 goto out; 416 } 417 sa->sa_family = dev->type; 418 memcpy(sa->sa_data, RTA_DATA(ida[IFLA_ADDRESS - 1]), 419 dev->addr_len); 420 err = dev->set_mac_address(dev, sa); 421 kfree(sa); |
409 if (err) 410 goto out; 411 send_addr_notify = 1; 412 } 413 414 if (ida[IFLA_BROADCAST - 1]) { 415 if (ida[IFLA_BROADCAST - 1]->rta_len != RTA_LENGTH(dev->addr_len)) 416 goto out; --- 394 unchanged lines hidden --- | 422 if (err) 423 goto out; 424 send_addr_notify = 1; 425 } 426 427 if (ida[IFLA_BROADCAST - 1]) { 428 if (ida[IFLA_BROADCAST - 1]->rta_len != RTA_LENGTH(dev->addr_len)) 429 goto out; --- 394 unchanged lines hidden --- |