Setting a host route in a kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I am trying to achieve the same change to the kernel routing table as if I would use

route add -host 1.2.3.4 eth0

I am trying this way:

--- SNIP ---

struct rtentry rmhost;
int err2;

memset(&rmhost, 0, sizeof(rmhost));
set_sockaddr((struct sockaddr_in *) &rmhost.rt_dst, ic_gateway, 0);
rm.rt_flags = RTF_UP | RTF_HOST;
rm.rt_dev = "eth0";
if ((err2 = ic_route_ioctl(SIOCADDRT, &rmhost)) < 0) {
	// error handling here
}

--- SNIP ---

I am getting an return value of -22 from ic_route_ioctl.

Does anyone have an idea

a) if I overlooked the obvious
b) what that error code (-22) might mean?

Regards,
Torsten

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux