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

[altq:1849] Re: struct flow_filter & qcmd_add_filter



Tiago Fioreze wrote:
> 	I have had problems when I try to add a filter to a class. I did the 
> following sequence:
> 
>         ---------------------------  BEGIN  ------------------------------
> 
>         struct flow_filter teste;
>        
>         memset(&teste, 0, sizeof(teste));
> 
>         teste.ff_flow.fi_dst.s_addr= inet_addr("200.18.42.6");
>         teste.ff_flow.fi_src.s_addr= inet_addr("200.18.42.86");
>         teste.ff_flow.fi_proto=6;

[snip]

> 	----------------------------   END --------------------------------
> 
> 	When the qcmd_add_filter is executed, I got the message:
> "syscall error: add filter failed!: Invalid argument"
> 
> 	What's the problem?

You need to set the address family field.

	teste.ff_flow.fi_family = AF_INET;

inet_addr(3) is deprecated and should not be used.

-Kenjiro